from enum import Enum

class VectorQuantizationType(str, Enum):
    """An enum representing the types of quantization available for vectors.

    Attributes:
        FP32 (str): 32-bit floating point quantization.
        FP16 (str): 16-bit floating point quantization.
        INT1 (str): 1-bit integer quantization.
        SPARSE (str): Sparse vector quantization.
    """

    FP32 = "FP32"
    FP16 = "FP16"
    INT1 = "INT1"
    SPARSE = "SPARSE"

    def __str__(self) -> str:
        return self.value

    @property
    def db_type(self) -> str:
        db_type_mapping = {
            "FP32": "vector",
            "FP16": "halfvec",
            "INT1": "bit",
            "SPARSE": "sparsevec",
        }
        return db_type_mapping[self.value]